/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-04-20
 * Time: 10:29
 */

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


public class Test1 {
    public static void copyFile(String sourcePath, String destinationPath) {
        Path source = Paths.get(sourcePath);
        Path destination = Paths.get(destinationPath);
        try {
            Files.copy(source, destination);
            System.out.println("文件复制成功");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        String sourcePath = "source.txt";
        String destinationPath = "destination.txt";
        copyFile(sourcePath, destinationPath);
    }


    public static void main1(String[] args) {
        String fileName = "26_video_frame_2.jpg";
        String[] parts = fileName.split("_");

        // 输出分割后的数组元素
        for (String part : parts) {
            System.out.println(part);
        }
    }

}
